﻿@{
    //excel path
    string path = Server.MapPath("~/upload/RefData/refdata.xls");
    string regionSheet = "Regions";
    string countrySheet = "Countries";
    string stateSheet = "States";
    
    
     List<Dictionary<string,string>> rdList=null;
    try{
        rdList = RefDataManager.ExtRefDataFromXLS(path,stateSheet);
        foreach(Dictionary<string,string> r in rdList){
           RefData rd = new RefData();
            rd.ParentRefType=r["ParentRefType"];
            rd.ParentRefID=r["ParentRefID"];
            rd.RefType=r["RefType"];
            rd.RefID=r["RefID"];
            rd.Active=0;
            rd.RefDesc=r["RefDesc"];
            RefDataManager.AddRefData(rd);
        }
    }catch(Exception e){
        throw e;
    }
    
}
